package org.zjt.config.extension;

import java.util.Objects;

/**
 * @author <a href="juntao.zhang@bkjk.com">juntao.zhang</a>
 * @Description:
 * @Package org.zjt.spiextensiondemo.domain
 * @date 2017/12/4 19:01
 * @see
 */
public class ExtensionKey<T> {

    private String name;

    private Class<T> t;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Class<T> getT() {
        return t;
    }

    public void setT(Class<T> t) {
        this.t = t;
    }

    public ExtensionKey() {
    }

    public ExtensionKey(String name, Class<T> t) {
        this.name = name;
        this.t = t;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ExtensionKey<?> that = (ExtensionKey<?>) o;
        return Objects.equals(name, that.name) &&
                Objects.equals(t, that.t);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, t);
    }
}
